# -*- coding: utf-8 -*-
from collections import defaultdict

from kivy.app import App
from hat_widget import *
from model import gamestate


class GameResults(HatWidget):
    def __init__(self, gamestate, presenter, **kwargs):
        super(GameResults, self).__init__(presenter, **kwargs)
        self.results_panel.init_widget(gamestate, presenter)
        self.gamestate = gamestate

    def new_game(self):
        self.presenter.restart()

    def next_round(self):
        self.presenter.save_statistics()
        self.presenter.change_phase(gamestate.Phase.NEXT_ROUND)

    def sort_style(x, sortid):
        return
